var host = "";
try {
	host = top.window.location.protocol + "//" + top.window.location.host + "/";
} catch (e) {
	host = window.location.protocol + "//" + window.location.host + "/";
}
var loca_Url = window.location.href.split("/");
if (loca_Url[3] != "common") {
	host += loca_Url[3] + "/";
}
var ctx = host;

document.write("<script src='" + host + "script/js/jquery-1.9.1.min.js'></script>");
document.write("<link href='" + host + "script/js/layui/css/layui.css' rel='stylesheet' type='text/css' ></link>");
document.write("<script src='" + host + "script/js/layui/layui.js'></script>");
document.write("<script src='" + host + "script/js/layui/formSelects-v3.js'></script>");
document.write("<script src='" + host + "script/js/vue.min.js'></script>");
document.write("<script src='" + host + "script/js/vue-resource.min.js'></script>");
function nvl(value) {
	return value ? value : "";
}
function alertObject(obj) {
	var str = [];
	for (var key in obj) {
		str.push(key + ":" + obj[key]);
	}
	alert(str.join(",\n"));
}
function dateToChar(day) {
	var date = new Date();
	date.setDate(date.getDate() - day);
	var month = date.getMonth()+1;
	month = month < 10 ? '0' + month : month;
	return date.getFullYear() + "-" + month + "-" + (date.getDate() < 10 ? "0" : "") + date.getDate();
}

function request(paras) {
	if (window.url_params_Obj == undefined) {
		var search = window.location.search;
		if (search) {
			search = search.substring(1);
		}
		var paraString = search.split("&");
		window.url_params_Obj = {}
		for (var i = 0; i < paraString.length; i++) {
			var index = paraString[i].indexOf("=");
			try {
				window.url_params_Obj[paraString[i].substring(0, index)] = decodeURI(paraString[i].substring(index + 1));
			} catch (e) {
				window.url_params_Obj[paraString[i].substring(0, index)] = paraString[i].substring(index + 1);
			}
		}
	}
	return paras ? window.url_params_Obj[paras] : window.url_params_Obj;
}